import { createStore } from 'vuex'

//导入本地持久存储插件
import createPersistedState from "vuex-persistedstate";


//导入模块挂在
import cart from './modules/cart'
import category from './modules/category'
import user from './modules/user'
export default createStore({
  modules: {
    cart,
    category,
    user,
  },
  //配置插件
  plugins: [createPersistedState({
    //本地存储的名字
    key:'user-cart',
    //指定存储的模块
    paths: ['user','cart']
  })]
})
